<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

//class ValidationCode
class Rand_func extends CI_Controller {

    function __construct() {
        parent::__construct();
        //加载验证码类
    }

    function valcode() {
        ob_clean();
        ob_end_clean();
        $this->load->model('m_validationcode', 'validation');
        echo $this->validation->outImg('75', '28', '4');
    }

    function valcode_two() {
        $this->load->model('m_validationcode', 'validation');
        $image = $this->validation->outImg('60', '22', '4');
        $image->outImg();
    }

    public function check() {
        $this->load->library('session');
        if (strtoupper($this->input->post('valcode')) == strtoupper($this->session->userdata('valcode'))) {
            $this->session->set_userdata('coco', 'true');
            echo 'false';
//         		echo 'true'.strtoupper($this->input->post('valcode')) .'=='. strtoupper($this->session->userdata('valcode'));
        } else {
            $this->session->set_userdata('coco', 'false');
            echo 'true';
//         		echo 'false'.strtoupper($this->input->post('valcode')) .'=='. strtoupper($this->session->userdata('valcode'));
        }
    }

}

?>
